Function Reference

FileCreateNTFSLink

Creates an NTFS hardlink to a file or a directory

FileCreateNTFSLink ( "source", "hardlink" [, flag] )

 

Parameters

source Path of the source to which the hardlink will be created.
hardlink Path of the hardlink.
flag [optional] this flag determines whether to overwrite link if they already exist.
Can be a combination of the following:
 0 = (default) do not overwrite existing link
 1 = overwrite existing link

 

Return Value

Success: Returns 1.
Failure: Returns 0.

 

Remarks

The destination directory must already exist.

This function works only on volume with NTFS File system.

If the source is a file, the hardlink must be one the same volume.
If the source is a directory cross volume is allowed.

FileDelete or FileMove can be used on hardlink.

To manage the link with the explorer you can use the shell extension NTFSLink

 

Related

FileCreateShortCut

 

Example


FileChangeDir(@ScriptDir)

DirCreate('dir')
FileWriteLine("test.txt","test")
MsgBox(0,"Hardlink", FileCreateNTFSLink("dir\test.log", "test.txt",1))